package com.xj;

import com.alibaba.fastjson.JSONArray;
import com.xj.openapi4j.service.TransfersSaleOrderService;
import com.xj.threadpool.AsyncManager;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.TimerTask;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;


@Slf4j
//@SpringBootTest(classes = YonSuiteApiApplication.class,webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
//@SpringBootTest
//@RunWith(SpringJUnit4ClassRunner.class)
public class U8api {
   // @Autowired
    private   ThreadPoolTaskExecutor threadPoolTaskExecutor;



    public void test() throws Exception{
        try {
            Future<Integer> submit = threadPoolTaskExecutor.submit(() -> {
                int i = 1 / 0;
                return 3;
            });
            Integer i=  submit.get(30, TimeUnit.MINUTES);
        }catch (Exception err){
            err.printStackTrace();
            throw new RuntimeException(err);
        }finally {
            System.out.println("--------------------");
            threadPoolTaskExecutor.shutdown();
        }
    }

    @Test
    public  void  recordOper() throws Exception  {
      String   prodcode="1222";
      boolean result=   prodcode.matches("\\d+");
        System.out.println(result);
    }
}
